//
//  Group.m
//  friendslist
//
//  Created by zhangyi on 15/11/29.
//  Copyright © 2015年 zhangyi. All rights reserved.
//

#import "Group.h"
#import "Friend.h"

@implementation Group

+ (instancetype) GroupWithDict:(NSDictionary*)dict{
    return [[self alloc] initWithDict:dict];
}
- (instancetype) initWithDict:(NSDictionary*)dict{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
        NSMutableArray *muArr = [NSMutableArray array];
        for (NSDictionary *friendDict in self.friends) {
            Friend *f = [Friend friendWithDict:friendDict];
            [muArr addObject:f];
        }
        
        self.friends = [muArr copy];
    }
    
    
    return self;
}

@end


